<template>
	<view class="ohead">
		<u-sticky offset-top="0" h5-nav-height="0">
			<immerse></immerse>
			<!-- 顶部兼容组件APP端-结束 -->
			<view class="hone">
				<image class="hlogo" src="/static/home/logo.png" @click="gethome" />
				<view class="appdown">
					APP下载
				</view>
				<view class="hrview">
					<image class="souicon" v-if="issou" src="/static/home/sou.png" @click="getsou" />
					<image class="geng" src="/static/home/geng.png" @click="getpage" />
				</view>
			</view>
		</u-sticky>
		<Pubot :pubbotshow="pubbotshow" :currentpage="currentpage" @pubbotclose="pubbotclose"></Pubot>
	</view>
</template>

<script>
import { type } from 'os';

export default {
	props: {
		shaishow: {
			type: Boolean,
			default: false
		},
		cont:{
			type: String,
			default: ''
		},
		issou:{
			type:Boolean,
			default:true
		}
	
	},
	name: "Nheader",
	data() {
		return {
			ispayPop: true,
			animat: this.isanimate(),
			pubbotshow:false,
			currentpage:''
		};
	},
	created(){
		const pages = getCurrentPages(); // 获取加载的页面
		const currentPage = pages[pages.length - 1]; // 获取当前页面的对象
		const url = currentPage.route; // 当前页面url
		const options = currentPage.options; // 如果要获取url中所带的参数可以查看options
		// console.log(url)
		this.currentpage = url
	},
	methods: {
		getsou(){
			// uni.showToast({
			// 	title: '点击此处',
			// 	icon: 'success'
			// })
			this.navrouter("/pages/tabbar/TabSearch");
		},
		leftClick() {
			this.$emit("leftClick");
		},
		connectWallet(){
			
			this.$emit("connectWallet");
		},
		gettantwo(){
			this.$emit("gettantwo");
		},
		gethome(){
			uni.switchTab({ url: '/pages/tabbar/Tabhome' })
		},
		getpage(){
			this.pubbotshow = true
		},
		pubbotclose(){
			this.pubbotshow = false
		}
	}
}
</script>

<style scoped lang="scss">
.hone {
	background: #FFFFFF;
	height: 96rpx;
	box-shadow: 0rpx 10rpx 20rpx 0rpx rgba(202,205,217,0.14);
	opacity: 1;
	display: flex;
	flex-direction: row;
	align-items: center;
	padding: 0 30rpx;
	position: relative;
	z-index: 10;
	.hlogo{
		width: 152rpx;
		height: 48rpx;
		margin-right: 56rpx;
	}
	.appdown{
		padding: 8rpx 16rpx;
		border-radius: 50rpx;
		border: 1px solid #FA4E4E;
		font-weight: 400;
		font-size: 24rpx;
		color: #FA4E4E;
	}
	.hrview{
		margin-left: auto;
		display: flex;
		flex-direction: row;
		align-items: center;
		.souicon{
			width: 40rpx;
			height: 40rpx;
			margin-left: 60rpx;
		}
		.geng{
			width: 38rpx;
			height: 36rpx;
			margin-left: 60rpx;
		}
	}

}
</style>
